package com.zixun.repository;

import com.zixun.model.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface ArticleRepository extends JpaRepository<Article,Integer> {

    List<Article> findByTitle(String title);

    @Query("select a from Article a where a.id = :id")
    Article getArticleById(@Param("id")Integer id);

}
